package com.spdzen.support.exception;

import com.spdzen.support.result.BizResultCode;
import com.spdzen.support.result.ResultCode;

public class ResultCodeException extends Exception {
	private static final long serialVersionUID = 5841736487383441392L;

	private ResultCode resultCode;

	public ResultCodeException() {
		super();
	}
	
	public ResultCodeException(String message) {
		super(message);
		this.resultCode = BizResultCode.error(message);
	}
	
	public ResultCodeException(ResultCode resultCode) {
		super(resultCode.toString());
		this.resultCode = resultCode;
	}
	
	public ResultCodeException(String message, Throwable cause) {
		super(message, cause);
		this.resultCode = BizResultCode.error(message);
	}
	
	public ResultCodeException(ResultCode resultCode, Throwable cause) {
        super(resultCode.toString(), cause);
        this.resultCode = resultCode;
    }
	
	public ResultCodeException(Throwable cause) {
        super(cause);
    }

	public ResultCode getResultCode() {
		return resultCode;
	}

	public void setResultCode(ResultCode resultCode) {
		this.resultCode = resultCode;
	}

}
